<?php
/**
 * Created by PhpStorm.
 * User: guokunsheng
 * Date: 2018/6/7
 * Time: 17:30
 */

namespace app\web\controller;

use \think\Controller;
use think\Env;

class FortuneYear extends Controller
{
    public function index()
    {
        $v = input('v/d', null);//版本号可能不存在
        $year_demo = config('fortune.year_demo');
        if (!empty($v))
        {
            if (in_array($v, [1, 2], false) && $this->request->header('app-type') !== 'android')
            {
                $v = 2;
            }
            $year_demo = config('fortune.year_demo' . $v);
        }
        return $this->fetch('index', ['year_demo' => $year_demo]);
    }

    /**
     * 年运大礼包详情介绍
     */
    public function active_details()
    {
        // m站地址host
        $host = Env::get('host.m');
        // 图片host
        $img_host = Env::get('host.photo');

        return $this->fetch('active_details', ['host' => $host, 'img_host' => $img_host]);
    }
}
